

<template>
    <div class="size-full flex justify-center items-center">
        <div class="max-w-3xl -translate-y-24 w-full flex justify-center flex-col items-center gap-5">
            <h1 v-if="diyTopic.title || diyTopic.logo" class="text-5xl font-bold flex items-center gap-4">
                <el-image
                    v-if="diyTopic.logo"
                    :src="diyTopic.logo"
                    class="w-[34px] h-[34px]"
                />
                <span v-if="diyTopic.title">{{ diyTopic.title }}</span>
            </h1>
            <p v-if="diyTopic.intro" class="line-clamp-1 text-tx-regular">
                {{ diyTopic.intro }}
            </p>
            <chatting-input-simple
                ref="chatActionRef"
                :maxUploadNum="robotDetail?.max_upload_num"
                :isUploadFiles="robotDetail?.is_upload_files"
                :isUploadImage="robotDetail?.is_upload_image"
                :isWebSearch="robotDetail?.is_web_search"
                @search="(e: boolean) => emits('search', e)"
                @sending="emits('sending')"
            />
        </div>
    </div>
</template>

<script setup lang="ts">
import { diyEnum } from '~/enums/app'
import useAppStore from '~/stores/app'

const emits = defineEmits(['sending', 'search', 'jump'])
withDefaults(
    defineProps<{
        robotDetail: ChatRoomingInitResponse
    }>(),
    {}
)

const appStore = useAppStore()

// 装修数据
const diyData = await appStore.getDiy(diyEnum.DESK)
const diyTopic = diyData.boards.topic || {} as AppDiyBoardsTopic
</script>
